home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / TECHNICA / AUTOCAD / H108.ZIP / BOOST.ZIP / TIMEIT.LSP < prev   
Text File  |  1991-07-15  |  4KB  |  99 lines

  1. ;************************************************************************
  2. ;* File:    TIMEIT.LSP                        *
  3. ;* Date:    July 15, 1991                        *
  4. ;* Description: A LISP program to test performance of AutoCAD display    *
  5. ;*        drivers.  To load the program, enter AutoCAD and    *
  6. ;*        type:                            *
  7. ;*                                    *
  8. ;*            (LOAD "TIMEIT")                                     *
  9. ;*                                    *
  10. ;*        To start the program, type TIMEIT then enter a comment. *
  11. ;*        The result of the test is added to the file TIMEIT.    *
  12. ;*        The time placed in the file represents time to do a    *
  13. ;*        ZOOM or PAN redraw (one of the most critical operations *
  14. ;*        for a typical AutoCAD user).  The time is followed    *
  15. ;*        by the drawing name and comment.            *
  16. ;*                                    *
  17. ;* Feel free to distribute this program, as long as the address of the    *
  18. ;* author and copyright remains with it:                *
  19. ;* Graphics Software Labs (Publisher of AutoCAD display drivers)    *
  20. ;* 7906 Moonmist Circle, Huntington Beach, CA 92648, USA, (714)960-6361 *
  21. ;*   (c) Copyright Graphics Software Labs 1991, All Rights Reserved    *
  22. ;************************************************************************
  23.  
  24. (defun C:TIMEIT ()
  25.     (setq cmnt (getstring T "Enter comment: "))
  26.     (setq fd (open "timeit" "a"))
  27.     (command "time" "reset" "on" "")
  28.  
  29.     (command "redraw")
  30.     (command "redraw")
  31.     (command "redraw")
  32.  
  33.     (command "zoom" "5.123")
  34.     (setvar "userr1" (getvar "tdusrtimer"))
  35.     (command "zoom" "p")
  36.     (setvar "userr2" (- (getvar "tdusrtimer") (getvar "userr1")))
  37.     (setvar "userr3" (getvar "userr2"))
  38.  
  39.     (command "zoom" "5.123")
  40.     (setvar "userr1" (getvar "tdusrtimer"))
  41.     (command "zoom" "p")
  42.     (setvar "userr2" (- (getvar "tdusrtimer") (getvar "userr1")))
  43.     (setvar "userr3" (+ (getvar "userr2") (getvar "userr3")))
  44.  
  45.     (command "zoom" "5.123")
  46.     (setvar "userr1" (getvar "tdusrtimer"))
  47.     (command "zoom" "p")
  48.     (setvar "userr2" (- (getvar "tdusrtimer") (getvar "userr1")))
  49.     (setvar "userr3" (+ (getvar "userr2") (getvar "userr3")))
  50.  
  51.     (command "zoom" "5.123")
  52.     (setvar "userr1" (getvar "tdusrtimer"))
  53.     (command "zoom" "p")
  54.     (setvar "userr2" (- (getvar "tdusrtimer") (getvar "userr1")))
  55.     (setvar "userr3" (+ (getvar "userr2") (getvar "userr3")))
  56.  
  57.     (command "zoom" "5.123")
  58.     (setvar "userr1" (getvar "tdusrtimer"))
  59.     (command "zoom" "p")
  60.     (setvar "userr2" (- (getvar "tdusrtimer") (getvar "userr1")))
  61.     (setvar "userr3" (+ (getvar "userr2") (getvar "userr3")))
  62.  
  63.     (command "zoom" "5.123")
  64.     (setvar "userr1" (getvar "tdusrtimer"))
  65.     (command "zoom" "p")
  66.     (setvar "userr2" (- (getvar "tdusrtimer") (getvar "userr1")))
  67.     (setvar "userr3" (+ (getvar "userr2") (getvar "userr3")))
  68.  
  69.     (command "zoom" "5.123")
  70.     (setvar "userr1" (getvar "tdusrtimer"))
  71.     (command "zoom" "p")
  72.     (setvar "userr2" (- (getvar "tdusrtimer") (getvar "userr1")))
  73.     (setvar "userr3" (+ (getvar "userr2") (getvar "userr3")))
  74.  
  75.     (command "zoom" "5.123")
  76.     (setvar "userr1" (getvar "tdusrtimer"))
  77.     (command "zoom" "p")
  78.     (setvar "userr2" (- (getvar "tdusrtimer") (getvar "userr1")))
  79.     (setvar "userr3" (+ (getvar "userr2") (getvar "userr3")))
  80.  
  81.     (command "zoom" "5.123")
  82.     (setvar "userr1" (getvar "tdusrtimer"))
  83.     (command "zoom" "p")
  84.     (setvar "userr2" (- (getvar "tdusrtimer") (getvar "userr1")))
  85.     (setvar "userr3" (+ (getvar "userr2") (getvar "userr3")))
  86.  
  87.     (command "zoom" "5.123")
  88.     (setvar "userr1" (getvar "tdusrtimer"))
  89.     (command "zoom" "p")
  90.     (setvar "userr2" (- (getvar "tdusrtimer") (getvar "userr1")))
  91.     (setvar "userr3" (+ (getvar "userr2") (getvar "userr3")))
  92.  
  93.     (princ (* 8640.0 (getvar "userr3")) fd)
  94.     (princ (strcat " - [" (getvar "dwgname") "] " cmnt) fd)
  95.     (princ "\n" fd)
  96.     (close fd)
  97.     (command "resume")
  98. )
  99.